<?php
/* $Id: num_opened.php,v 1.3 2003/10/08 07:24:55 tuxmonkey Exp $ */

if (strpos($_SERVER['PHP_SELF'],basename(__FILE__)) !== false) {
  print "Direct module access forbidden.".basename(__FILE__);exit;}
  
if (in_array("opened",$_POST['options'])) {
  $sql  = "SELECT COUNT(issueid) ";
  $sql .= "FROM issues ";
  $sql .= $_GET['tech'] == "true" ? "WHERE opened_by = '$userid' " : "WHERE gid='$gid' ";
  $sql .= $_POST['use_date'] == "on" ? "AND opened BETWEEN '$sdate' AND '$edate'" : "";
  $opened = $dbi->fetch_one($sql);
  $smarty->assign('numopened',$opened);
}
?>
